import { useRouteStore } from "@/store/route";
export default () => {
  const routeStore = useRouteStore();

  const menuRoute = routeStore.menuRoute;

  let newArr = menuRoute.map((item) => {
    item.titles = [item.title];
    return item;
  });

  menuRoute.forEach((item) => {
    if (item.children.length) {
      item.children.forEach((child) => {
        // console.log(child);
        child.titles = item.titles.concat(child.title)
      });
      newArr.push(...item.children)
    }
  });
  // console.log(newArr);
  return newArr
};
